<template>
  <div class="select">
    <div class="selectbox">
      <p>{{ selected }}</p>
      <i @click="showselect()">o</i>
    </div>
    <div v-show="isShow">
      <div
        v-for="(item, index) in lists"
        :key="item.index"
        @click="sel(item, index)"
      >
        {{ item.value }}
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "asmAdd",
  data () {
    return {
      isShow: false,
      selected: '请选择',
      lists: [
        {
          text: '测试',
          value: 'test'
        },
        {
          text: '测试2',
          value: 'test2'
        }
      ]
    }
  },
  mounted () {

  },
  methods: {
    showselect () {
      this.isShow = !this.isShow
    },
    sel (item, index) {
      this.isShow = false,
        this.unitModel = index;
      this.selected = item.value
    }
  }
}
</script>

<style scoped>
</style>